package com.cocostudio.erpapp.view;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.webkit.JsResult;
import android.webkit.WebView;
import android.widget.ProgressBar;
import android.widget.Toast;

public class ProgressBarWebView extends WebView {

	private ProgressBar progressbar;

	public ProgressBarWebView(Context context, AttributeSet attrs) {
		super(context, attrs);
	    setWebViewClient(new WebViewClient(){});
		setWebChromeClient(new WebChromeClient());
	}
	
	public class WebViewClient extends android.webkit.WebViewClient{
	    @Override
        public boolean shouldOverrideUrlLoading(WebView view, String url){
                view.loadUrl(url);
                return false;
        }
	}
	public class WebChromeClient extends android.webkit.WebChromeClient {
		@Override
        public boolean onJsAlert(WebView view, String url, String message,
                JsResult result)
        {
		      //  result.
               Log.i("WebView", "onJSAlert message:"+message);
               //Toast.makeText(view.getContext(),message, Toast.LENGTH_LONG).show();
              // return true;
               return super.onJsAlert(view,url, message, result);
        }
	}
}
